package com.shenma2009.config;

/**
 * @author 军哥
 * @version 1.0
 * @description: ElasticSearchConfig
 * @date 2023/8/20 9:14
 */

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class ElasticSearchConfig {
    @Bean
    public RestHighLevelClient restHighLevelClient(){
        HttpHost localhost = new HttpHost("192.168.80.131",9200,"http");
        RestClientBuilder builder = RestClient.builder(localhost);
        return new RestHighLevelClient(builder);
    }
}
